<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
    <title>企业</title>
    <link rel="stylesheet" href="css/AllStyle.css" />
    <link rel="stylesheet" href="css/iconfont.css" />
    <link rel="stylesheet" href="css/swiper-3.3.1.min.css" />
    <link rel="stylesheet" href="css/font-awesome.css" />
    <script type="text/javascript" src="js/common.js" ></script>
    <script type="text/javascript" src="js/data.js" ></script>
    <script type="text/javascript" src="js/tmpl.js" ></script>
</head>
<body>
<section style="width: 100%;height:100%;position: absolute;overflow: hidden;">
	<section class="FormBlockOne">
		<nav>
			<span id="LogoButtom"><img width="50%" style="margin:20px auto;display: block;" src="images/logo.png"></span>
			<ul class="HomeNavLeft">
				<li class="username"><i class="iconfont icon-user"  ></i></li>
				<li class="videoClassify"><i class="iconfont icon-icon"></i>扫描发货</li>
				<li class="lot"><i class="iconfont icon-iconfontdaifahuo"></i>批量发货</li>
				<li class="query"><i class="iconfont icon-chaxun"></i>查询标签</li>
				<li class="ChangePassword"><i class="iconfont icon-xiugai"></i>修改密码</li>
				<li class="logout"><i class="iconfont icon-tuichu"></i>退出登录</li>
			</ul>
		</nav>
	</section>
	<div id="SlideMaskLayer"></div>

	<section class="FormBlockTwo" id="FormBlockTwo">

		<!-- 页眉 -->
	    <section>
		    <script type="text/javascript">
		        writePageHeader('');
		    </script>
	    </section>

	    <!-- 内容 -->
	    <section class="AllContent" id="pullrefresh">
	    	<div class="SiteMain">
	    		<!-- 焦点图 -->
			    <section>
				    <script type="text/javascript">
				        FocusPicture();
				    </script>
			    </section>

	    		<p style="height:5px;background-color: #f3f3f3;"></p>

	    		<div class="SiteMainBlock">
	    			<ul id="myList">
						<li class="engineeringList">
							<p><i class="iconfont icon-inv-add"></i></im></p>
							<p>构件</p>
						</li>
	    				<li class="procList">
	    					<p><i class="iconfont icon-saoma"></i></im></p>
	    					<p>报工</p>
	    				</li>
						<li class="qualityList">
							<p><i class="iconfont icon-inv-add"></i></im></p>
							<p>质检</p>
						</li>
						<li class="myReportingList">
							<p><i class="iconfont icon-inv-add"></i></im></p>
							<p>我的报工</p>
						</li>
						<li class="myQualityList">
							<p><i class="iconfont icon-inv-add"></i></im></p>
							<p>我的质检</p>
						</li>
<!--						<li class="scanReporting">-->
<!--							<p><i class="iconfont icon-saoma"></i></im></p>-->
<!--							<p>扫码报工</p>-->
<!--						</li>-->
	    			</ul>
	    		</div>
	    		<p class="CopyRight">鑫晟钢业MES报工系统<i></i></p>
	    	</div>
	    </section>
	</section>
</section>
</body>
<script type="text/javascript" src="js/jquery.min.js" ></script>
<script type="text/javascript" src="js/swiper-3.3.1.min.js" ></script>
<script type="text/javascript" src="js/mui.min.js" ></script>
<script type="text/javascript" src="js/echarts/common.js" ></script>
<script type="text/javascript" src="js/update.js" ></script>
<script type="text/javascript" src="js/AllJS.js" ></script>
<script type="text/javascript" src="js/data.js"></script>
<script type="text/javascript">

	var showMenu = false;
    mui.init({
		pullRefresh: {
			container: '#pullrefresh',
			down: {
				contentdown : "<div style='text-align:center;fonr-size:0.95em;color:#ccc;'>下拉刷新</div>",
			    contentover : '<div style="width:100%;background:#fff;"><img style="width: 20%;margin:0px auto;display:block;" src="images/loading5_.jpg" /><p style="text-align:center;color:#777;padding:5px 0px;">释放加载...</p></div>',
			    contentrefresh : '<div style="width:100%;background:#fff;"><img style="width: 20%;margin:0px auto;display:block;" src="images/loading5.gif" /><p style="text-align:center;color:#777;padding:5px 0px;">正在加载...</p></div>',
				callback: pullupRefresh,
			}
		}
	});

	//添加refresh自定义事件监听
	window.addEventListener('supper',function(){
		var id = event.detail.id;
		mui.openWindow({
			url: 'frame.html?frameId='+id,
			id:'frame.html',
			createNew:true
		});
	});

	function pullupRefresh() {
	}

  	var publicity = new Swiper('.swiper-publicity',{
		autoplay: 3000
	});

	var clickNum = 1;

	$('.AddBlock').on('tap',function(){
		if(clickNum == 1){
			$(this).find('p:eq(0)').css({transform:'rotate(360deg)',transition:'All 1s ease-in-out',color:'#ccc'});
			$(this).find('p:eq(1)').text('没有更多').css({transition:'All 1s ease-in-out',color:'#ccc'});
			clickNum++;
		}else{
			$(this).find('p:eq(0)').css({transform:'rotate(-360deg)',transition:'All 1s ease-in-out',color:'#666'});
			$(this).find('p:eq(1)').text('添加').css({transition:'All 1s ease-in-out',color:'#666'});
			clickNum--;
		}
	});

	$('#frameList').on('tap',function(){
		mui.openWindow({
			url: 'frameList.html',
			id:'frameList.html',
			createNew:true
		});
	});

	$('#procList').on('tap',function(){
		mui.openWindow({
			url: 'procList.html',
		    id:'procList.html',
			createNew:true
		});
	});

	$('#qualityList').on('tap',function(){
		mui.openWindow({
			 url: 'qualityList.html',
		    id:'qualityList.html',
			createNew:true
		});
	});

	jQuery(function () {
		if(getCookie("token") === null || getCookie("token") === ''){
			window.location.href='login.html';
			return;
		}
					$('.username').text(getCookie("username"));
					$("#homepagemessageid").hide();
	        $("#homepagemessageid").html("");
					document.addEventListener('deviceready', onDeviceReady, true);
	        var u = navigator.userAgent, app = navigator.appVersion;
			var isAndroid = u.indexOf('Android') > -1 || u.indexOf('Linux') > -1; //android终端或者uc浏览器
			var isiOS = !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/); //ios终端

			if (+isAndroid) {



			}else{
				$('.SiteMain').css({marginTop:'-23px'});
			}
	    });
	    function onDeviceReady() {
	        document.addEventListener("backbutton", onBackKeyDown, false);
	    }
	    function onBackKeyDown() {
	        hideLoading();
	        // Handle the back button
	        exitFromApp();
	    }

	    function onsuccess() {
	    }
	    function proccessTextQuery() {
	        if(!empty($("#itemcode").val())) {
	            loadUrl("query.html", "itemcode", $("#itemcode").val());
	        }else {
	            alert("请输入产品编号！");
	        }

	    }

	$(function(){
		if (getCookie("userName")!=='admin'){
			let workType = $_GET['workType'];
			let UI ='<li class="frameList"><p><i class="iconfont icon-inv-add"></i></im></p><p>构件</p></li>';
			if (workType !== undefined && workType !== null && workType !== '' && workType !== 'null'){
				if (workType === '1'){
					UI += '<li class="procList"><p><i class="iconfont icon-saoma"></i></im></p><p>报工</p></li>' +
							'<li class="allProcList"><p><i class="iconfont icon-saoma"></i></im></p><p>全部报工</p></li>' +
							'<li class="myReportingList"><p><i class="iconfont icon-inv-add"></i></im></p><p>我的报工</p></li>';
				}else if (workType === '2'){
					UI += '<li class="qualityList"><p><i class="iconfont icon-inv-add"></i></im></p><p>质检</p></li>' +
							'<li class="allQualityList"><p><i class="iconfont icon-inv-add"></i></im></p><p>全部质检</p></li>' +
							'<li class="myQualityList"><p><i class="iconfont icon-inv-add"></i></im></p><p>我的质检</p></li>';
				}
			}
			$('#myList').html(UI);
		}
		//扫描器
		$(".Scanner").on('tap',function(){
		  mui.openWindow({
		    url: 'Scanner.html?etk=1',
		    id:'Scanner.html'
		  });
		});

		$('.SiteMainBlock ul li').on('tap',function(){
			var val = $(this).attr('class');
			mui.openWindow({
				url: val+'.html',
				id:val+'.html',
				createNew:true
			});
		})

		$(".logout").on('tap',function(){
		  logout();
		});
		$("#downData").on('tap',function(){
			$.ajax({//一个Ajax过程
			    type: "get", //以post方式与后台沟通
			    url: getServerUrl() + "/almes/admin/sync/sync/startSyncManual", //与此php页面沟通
			    dataType: 'json', //从php返回的值以 JSON方式 解释
			    data: 'access_token=' + getToken(),
			    success: function (json) {//如果调用php成功
			        if(json.statusCode == "200"){
			           alertMessage(json.message)

			        }else{
			            alertMessage(json.message);
			        }

			    }
			});
		})
	});
	var first = null;
	mui.plusReady(function() {
	    mui.back=function(){
			plus.runtime.quit();
	    };
	});

	mui.init();
</script>
</html>
